/*
 * TCSS 360 - Autumn 2011
 * Group2: ManuscriptPR 
 * 
 * Role enumeration
 * Author: Tony Butterfield
 */
package user;

/**
 * an enumeration of conference Roles.
 * @author Tony Butterfield
 * @version 11/29/2011
 */
public enum Role 
{
  
  
  /**
   * Conference program chair.
   * Each conference must have at least one program chair to assign reviewers and to make the 
   * decision to accept or reject submitted manuals
   */
  PROGRAM_CHAIR,
  
  /**the_index
   * Conference Author.
   * The default status of any new User, the Author can submit manuscripts.
   */
  AUTHOR,
  
  /**
   * Conference Reviewer.
   * Assigned to specific manuscripts, the Reviewer can download the manuscript and upload 
   * their reviews
   */
  REVIEWER;
    

/**
 * parses a string representation of a role.
 * @param the_string to be parsed
 * @return Role described
 */
  public static Role parseString(final String the_string)
  {
    Role result = null;

    if (the_string != null)
    {

      if ("Program Chair".equals(the_string))
      {
        result = PROGRAM_CHAIR;
      }

      if ("Author".equals(the_string))
      {
        result = AUTHOR;
      }

      if ("Reviewer".equals(the_string))
      {
        result = REVIEWER;
      }

    }

    return result;
  }

}

